package com.cmict.data.bpm.enums.externalfile;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * BPM 流程附件的枚举
 */
@Getter
@AllArgsConstructor
public enum ExternalFileTypeEnum {

    IMAGE(1, "图片"),

    FILE(2, "文件"),
    OTHER(3, "其他");

    private final Integer type;
    private final String desc;

    public static ExternalFileTypeEnum typeOf(Integer type) {
        if (type != null) {
            for (ExternalFileTypeEnum typeEnum : ExternalFileTypeEnum.values()) {
                if (type.equals(typeEnum.getType())) {
                    return typeEnum;
                }
            }
        }
        return OTHER;
    }
}
